 //处理侧边栏导航


 let iconList = [
    {name:"首页",icon:'icon-shouye'},
    {name:"工作台",icon:'icon-7'},
    {name:"组件",icon:'icon-sousuo'},
    
 ]

 //根据  name =>icon
 export  const getIcon =(name:string)=>{
        
    //1创建icon图表库=》根据ui 将侧边栏导航 所有的icon 放到一个表中

     let obj = iconList.find((item,index)=>{
           return item.name ==name
     })
        //有值
     if(obj){
            return obj.icon
     }else{ //默认的图标
           return "icon-yonghu"
     }
}



let navPath = [

    {name:"首页",path:'home'},
    {name:"工作台",path:'work'},
    {name:"message",path:'message'},
    {name:"图表",path:'echarts'},
    { name: "财务", path: "finance" },
    { name: "直播", path: "play" },

    { name: "视频", path: "video" },


]
export const changePath = (path:string)=>{
         
     let obj = navPath.find((item,index)=>{
        return item.name ==path
  })
     //有值
  if(obj){
         return obj.path
  }else{ //默认的图标
        return "404"
  }
}

